Skip to content

spacetime dev - Replace template selection with fuzzy-filterable menu#4470

Merged
bfops merged 13 commits intomasterfrom
bot/fuzzy-template-select
Mar 5, 2026
Merged

spacetime dev - Replace template selection with fuzzy-filterable menu#4470
bfops merged 13 commits intomasterfrom
bot/fuzzy-template-select

Conversation

@clockwork-labs-bot
Copy link
Collaborator

@clockwork-labs-bot clockwork-labs-bot commented Feb 26, 2026

This pull request updates the template system to support richer metadata and improves the interactive CLI experience for selecting templates. The main changes are the addition of a client_framework field to template metadata, a refactor of the templates JSON generation and parsing, and a redesign of the interactive template selection flow to group templates by language/framework and use fuzzy search for easier navigation.

image

Template Metadata and Serialization Improvements:

  • Added a new client_framework field to all template metadata files (e.g., .template.json) and updated the Rust structs (TemplateInfo, TemplateDefinition, etc.) to support this field, enabling more descriptive and flexible template selection. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Refactored the templates JSON generation to use serde for serialization, replacing manual string building, and ensured that optional string fields serialize as empty strings when not present.

CLI Interactive Template Selection Redesign:

  • Removed the previous "highlights" concept and reworked the interactive selection to group templates by language/framework combinations, showing counts and using fuzzy search for easier filtering. [1] [2] [3]
  • Updated the selection menus to allow users to pick a language/framework group, then choose from multiple templates if available, or opt to clone from GitHub or select "None." [1] [2]
  • Improved language label formatting for better user experience in the CLI prompt.

Codebase Cleanup and API Changes:

  • Removed unused highlight-related structs and logic from the CLI, simplifying the template fetching API to return only templates. [1] [2]
  • Updated all template selection logic to use the new API and data structures. [1] [2]

These changes make template selection more intuitive and scalable as more templates and frameworks are added.

The old flow had two steps: (1) select from a short highlights list, then
(2) if 'Use Template' was chosen, dump a flat list and type an ID. The
user couldn't filter or navigate the full template list interactively.

Now uses a single FuzzySelect showing all templates (ID + description).
Type to fuzzy-filter by template ID or description, arrow keys to navigate,
Enter to select. 'Clone from GitHub' and 'None (server only)' are at the
bottom. Default highlights to the first highlighted template (react-ts).

GitHub URL support is preserved — selecting 'Clone from GitHub' prompts
for an owner/repo or git URL.
bfops
bfops previously approved these changes Feb 26, 2026
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for me!

Would you like to initialize a new project? yes
✔ Project name · zeke-test
✔ Project path · ./zeke-test
✔ Database name · zeke-test
? Select a template (type to filter, arrows to navigate) › rust 
❯ basic-rs - A basic Rust client and server template with only stubs for code
  chat-console-rs - Rust server/client implementing quickstart chat
  nextjs-ts - Next.js App Router with TypeScript server
  tanstack-ts - TanStack Start (React + TanStack Query/Router) with TypeScript server
  chat-console-cs - C# server/client implementing quickstart chat
  chat-react-ts - TypeScript server/client implementing quickstart chat
  angular-ts - Angular web app with TypeScript server

if I type something that doesn't match, <Enter> does nothing.

I didn't test the github repo variant but code looks reasonable to me (and didn't change any of the details of parsing the url or anything).

@bfops bfops changed the title Replace template selection with fuzzy-filterable menu spacetime dev - Replace template selection with fuzzy-filterable menu Feb 26, 2026
@bfops bfops dismissed their stale review February 26, 2026 03:26

dismissing my review because I'm waiting for another approval and I don't want the bot merging this prematurely

@bfops bfops disabled auto-merge February 26, 2026 03:26
dialoguer's FuzzySelect clears and redraws all visible items on every
keystroke. With 20+ templates the redraw area is large, causing visible
flicker. Limiting to 10 visible rows (scrollable) reduces the effect.
@jdetter jdetter force-pushed the bot/fuzzy-template-select branch from 684f81c to a89dd79 Compare February 26, 2026 05:12
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested working, thank you @bfops !

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only one that I would change (or at least would like the chance to discuss first).

The idea with the old setup was that we'd have a more beginner friendly "pick your framework" selection, and then only if you opted to use a template would you be presented with the list of more complex template names. I think we should preserve the two step process, but I think probably both should be fuzzy selectors.

clockwork-labs-bot and others added 8 commits February 26, 2026 14:49
Restores the original two-step selection:
1. First menu (Select): language/framework highlights + 'Use Template' + 'None'
2. Second menu (FuzzySelect): all templates with type-to-filter, shown
   only when 'Use Template' is selected

This keeps the fuzzy-find UX improvement for template browsing while
preserving the quick-pick highlights for common choices.
@bfops bfops requested a review from cloutiertyler March 3, 2026 22:43
@bfops bfops added this pull request to the merge queue Mar 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 4, 2026
@bfops bfops added this pull request to the merge queue Mar 4, 2026
Merged via the queue into master with commit 476d157 Mar 5, 2026
33 checks passed
@bfops bfops deleted the bot/fuzzy-template-select branch March 5, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants